#ifndef Z_FLOOR
#define Z_FLOOR

#include "stdafx.h"

#include "S_wall.h"
#include "S_window.h"
#include "S_door.h"

class floor{
public:
    inline floor();
    inline void setDC(CDC *pDC);
    inline void getDC(CDC *&pDC);
    inline void addWall(int x1,int y1,int x2,int y2);
    inline void addDoor(int x1,int y1,int x2,int y2);
    inline void addWindow(int x1,int y1,int x2,int y2);
    inline void Draw();
    
private:
    CDC *p;
    wall wal;
    safewindow windo[5];
    safedoor door[5];
    int num_door,num_win;
};

floor::floor(){
    p=NULL;
    num_door = 0;
    num_win = 0;
}

void floor::setDC(CDC *pDC){
    p = pDC;
}

void floor::getDC(CDC *&pDC){
    pDC = p;
}

void floor::addWall(int x1, int y1, int x2, int y2){
    wal.setposation(x1,y1,x2,y2);
}

void floor::addDoor(int x1, int y1, int x2, int y2){
    if(num_door>=3)
        AfxMessageBox(_T("doorwrong!"));
    door[num_door].setposation(x1,y1,x2,y2);
    num_door++;
}

void floor::addWindow(int x1, int y1, int x2, int y2){
    if(num_win>=3)
        AfxMessageBox(_T("windowwrong!"));
    windo[num_win].setposation(x1,y1,x2,y2);
    num_win++;
}
    
void floor::Draw(){
    
    for(int i = 0;i <=num_win ; i++){
        windo[i].Draw(p);
    }
    for(int j = 0;j <= num_door ; j++){
        door[j].Draw(p);
    }
    wal.Draw(p);
}




#endif
    